/*
 * codeJam.c
 *
 *  Created on: 22-Feb-2012
 *      Author: Ashok
 */

/* Problem statement to be solved
 * 0: Problem A. Bot Trust (http://code.google.com/codejam/contest/975485/dashboard)
 *
 */
#define PROBLEM 0

#define P_BOTTRUST 0

#include "codeJam.h"


extern void btMain(void);


/* Function declarations */
static FILE* cjOpenInput(void);
static void cjProcessInput(void);
static void cjGetTC(void);
static void cjWriteOutput(int *in, int noOfIn);

/* Global variables */
int TC;
FILE* inFile;
FILE* outFile;

int main(void){
	codeJam();
}

int codeJam(void){
	//cjProcessInput();
	#if PROBLEM == P_BOTTRUST
		btMain();
	#else if PROBLEM == 100
	#endif
	return 0;
}


static void cjProcessInput(){
	btInp = openInput();
	fscanf(btInp, "%d", &btNoOfTC);
}

static void cjGetTC(void){
	char inputStr[505];
	int noOfTS, i, o, b;
	fscanf(btInp, "%s", &inputStr);
	sscanf(inputStr, "%d", &noOfTS);
	for(i = 0, o = 0, b = 0; i < noOfTS; i++){
		sscanf(inputStr, )
	}
}

static FILE* cjOpenInput(void) {
	FILE *fp;
	puts("START OF PROGRAM");

	fp = fopen("D:/09_Projects/AlgoEcp/algo_1/src/input.txt", "r");
	if(fp == NULL)
		printf("file not found");
	return fp;
}


static void cjWriteOutput(int *in, int noOfIn) {
	FILE *fp;
	int idx;
	puts("Writing output to buffer");

	fp = fopen("D:/09_Projects/AlgoEcp/algo_1/src/sortOutput.csv", "w");
	if(fp == NULL)
		printf("file not found");
	else {
		fprintf(fp, "%d", noOfIn);
		for(idx = 0; idx < noOfIn; idx++) {
			fprintf(fp, "\n%d", in[idx]);
		}
	}
	fclose(fp);
	free(in);
}
